import timber.data.XMLData;


/**
	Allows nodes in an XMLData object to behave as arrays once the length property has been accessed.
	
	@implementationNote Private properties are prefixed with $ to hide from the parser.
	
	@author  Chandler McWilliams
	@version 2005-06-08


*/

dynamic class timber.data.XMLDataNode
{
	private var $length = false;
	
	public function get length() {
		if ($length === false) {
			this[0] = {};
			for (var p in this) this[0][p] = this[p];
			$length = 1;
			ASSetPropFlags(this, ['$length', 0], 1);
		}
		return $length;
	}	
	
	public function toString() { return this._value; }
}
